<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>二手车管理平台后台首页</title>
    <link rel="stylesheet" href="/res/css/global.css">
    <link rel="stylesheet" href="/res/css/main.css">
</head>
<body>
<!-- 外部容器 -->
<div id="container">
    <!-- 左边的导航栏div -->
    <div id="nav-list" class="left">
        <h2>
            <span th:text="${session.emp.get('empName')}"></span>
            &nbsp;&nbsp;
            <span th:text="${session.emp.get('roleName')}"></span>
            &nbsp;&nbsp;
            <a href="/emp/logout">退出</a>
        </h2>
        <ul>
            <li><a href="/main">主页</a></li>
            <li><a href="/customer/select_customer">会员管理</a></li>
            <li><a href="/emp/select_emp">员工管理</a></li>
            <li><a href="#">二手车管理</a></li>
            <li><a href="#">门店管理</a></li>
            <li><a href="/system/main">系统设置</a></li>
        </ul>
    </div>

    <!-- 右边的div -->
    <div id="main-div" class="right">
        <h2>修改员工</h2>
        <form action="/emp/update_emp" method="post">
            <input type="hidden" name="id" th:value="${emp.id}"/>
            <table>
                <tr>
                    <td>登录名：</td>
                    <td>
                        <span th:text="${emp.empId}"></span>
                    </td>
                </tr>
                <tr>
                    <td>姓名：</td>
                    <td>
                        <input type="text" name="empName" th:value="${emp.empName}"/>
                    </td>
                </tr>
                <tr>
                    <td>性别：</td>
                    <td>
                       <input type="radio" name="sex" value="男" th:field="*{emp.sex}"/>男
                        &nbsp;&nbsp;
                        <input type="radio" name="sex" value="女" th:field="*{emp.sex}"/>女
                    </td>
                </tr>
                <tr>
                    <td>生日：</td>
                    <td>
                        <input type="date" name="birthday" th:value="${#dates.format(emp.birthday,'yyyy-MM-dd')}"/>
                    </td>
                </tr>
                <tr>
                    <td>身份证：</td>
                    <td>
                        <input type="text" name="idcard" th:value="${emp.idcard}"/>
                    </td>
                </tr>
                <tr>
                    <td>电话：</td>
                    <td>
                        <input type="text" name="phone" th:value="${emp.phone}"/>
                    </td>
                </tr>
                <tr>
                    <td>门店：</td>
                    <td>
                        <select id="storeId" name="storeId">
                            <option th:each="store:${stores}" th:value="${store.id}" th:text="${store.storeName}"
                                th:selected="${store.id eq emp.storeId}"></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>角色：</td>
                    <td>
                        <select id="roleId" name="roleId">
                            <option th:each="role:${roles}" th:value="${role.id}" th:text="${role.roleName}"
                                th:selected="${role.id == emp.roleId}"></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>
                        <input type="submit" value=" 更新员工 "/>
                    </td>
                </tr>
            </table>
        </form>



    </div>
</div>
</body>
</html>